import requests from '../config/request.js'

//获取商品列表
export const mallProductList = (payload) => {
    return requests.httpRequest({
        url: "StoreSale/GetStoreProductList",
        data:payload
    });
};


//获取商品详情
export const mallProductInfo = (payload) => {
    return requests.httpRequest({
        url: "StoreSale/GetStoreProductbyId",
        data:payload
    });
};

//获取快递运费
export const getStoreFreight = (payload) => {
    return requests.httpRequest({
        url: "StoreSale/GetStoreFreight",
        data:payload
    });
};

//获取商城订单
// export const getAppMyStoreOrderInfoList = (payload) => {
//     return requests.httpTokenRequest({
//         url: "Customer/GetAppMyStoreOrderInfoList",
//         data:payload
//     });
// };


//获取商城订单
// export const getAppStoreOrderDetail = (payload) => {
//     return requests.httpTokenRequest({
//         url: "Customer/GetAppStoreOrderDetail",
//         data:payload
//     });
// };

//修改订单状态
export const updateStoreOrderStatus = (payload) => {
    return requests.httpTokenRequest({
        url: "Customer/UpdateStoreOrderStatus",
        data:payload
    });
};

//获取商品详情
export const getProductCategory = (payload) => {
    return requests.httpRequest({
        url: "StoreSale/GetProductCategory",
        data:payload
    });
};


//获取商城商品
export const getWebStoreProductInfoList = (payload) => {
    return requests.httpRequest({
        url: "StoreSale/GetWebStoreProductInfoList",
        data:payload
    });
};

// **************************************新

export const allCategory = (payload) => {
    return requests.httpRequest({
        url: "/client/mallProduct/allCategory",
        data:payload
    });
};
export const queryProductByCate = (payload) => {
    return requests.httpRequest({
        url: "/client/mallProduct/queryProductByCate?categoryId="+payload,
        // data:payload
    });
};

export const getMallProductById = (payload) => {
    return requests.requestAll("/client/mallProduct/getMallProductById?id="+payload);
};

//获取商城订单
export const getAppMyStoreOrderInfoList = (payload) => {
   return requests.requestAll("/client/mallProduct/mallProductOrderList",'post',payload,false);
};
// 取消订单
export const orderCancel = (payload) => {
   return requests.requestAll("/client/pay/orderCancel",'post',payload,false);
};
// 订单详情
export const getAppStoreOrderDetail = (payload) => {
   return requests.requestAll("/client/mallProduct/getMallProductOrder",'get',payload);
};

export const listMallProduct = (payload) => {
	 return requests.requestAll("/client/mallProduct/listMallProduct",'post',payload,false);
};
